home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // ================= Callbacks for each section ======================
- global proc jasperTabMenuChange(
- string $jasperCommand,
- string $parent
- )
- {
- string $currentTab = `tabLayout -query -selectTab $parent`;
-
- if( $currentTab == "Sculpt"
- || $currentTab == "Weight"
- || $currentTab == "Script_Paint"
- || attrPaintInstCheckCurrentTab($currentTab) )
- {
- string $cmd;
-
- $cmd = ($jasperCommand + " -q -brushoperate `currentCtx`");
- string $type = `eval $cmd`;
- if ( ( $type != "paint" )
- && ( eval( "floatSliderGrp -ex commEdgesTol" ) )
- && ( eval( "floatSliderGrp -ex collapseCVTol" ) ) )
- {
- $cmd = $jasperCommand + "-e -brushoperate \"paint\" `currentCtx`";
- eval $cmd;
- updateCommEdgeDisplayScreen $jasperCommand;
- radioButtonGrp -e -sl 1 brushOperationType;
- }
- }
- }
-
- global proc updateBrushShapeIcons(
- string $selectType
- )
- {
- symbolCheckBox -e -v false bsCirclePoly;
- symbolCheckBox -e -v false bsCircleGaus;
- symbolCheckBox -e -v false bsCircleSolid;
- symbolCheckBox -e -v false bsSemiCirclePoly;
- symbolCheckBox -e -v false bsSemiCircleSolid;
- symbolCheckBox -e -v false bsRect;
- symbolCheckBox -e -v false bsLineH;
- symbolCheckBox -e -v false bsLineV;
-
- switch( $selectType ) {
- case "-byCirclePoly":
- symbolCheckBox -e -v true bsCirclePoly;
- break;
- case "-byCircleGaus":
- symbolCheckBox -e -v true bsCircleGaus;
- break;
- case "-byCircleSolid":
- symbolCheckBox -e -v true bsCircleSolid;
- break;
- case "-bySemiCirclePoly":
- symbolCheckBox -e -v true bsSemiCirclePoly;
- break;
- case "-bySemiCircleSolid":
- symbolCheckBox -e -v true bsSemiCircleSolid;
- break;
- case "-byRect":
- symbolCheckBox -e -v true bsRect;
- break;
- case "-byLineH":
- symbolCheckBox -e -v true bsLineH;
- break;
- case "-byLineV":
- symbolCheckBox -e -v true bsLineV;
- break;
- }
- }
-
- global proc resetTabletAttr( )
- {
- // initialize the scaling factor for tablet variable
- setInputDeviceMapping -d "tablet" -ax "pen:tilt:X" -s 1 -o 0 -a -w ;
- setInputDeviceMapping -d "tablet" -ax "pen:tilt:Y" -s 1 -o 0 -a -w ;
- setInputDeviceMapping -d "tablet" -ax "pen:penID" -s 1 -o 0 -a -w ;
- }
-
- global proc jasperSetLowerRadius( string $jasperCommand )
- {
- float $radius = `floatSliderGrp -q -v radius`;
- float $lowerRadius = `floatSliderGrp -q -v lowerRadius`;
-
- if( $lowerRadius > $radius ) {
- floatSliderGrp -e -v $radius lowerRadius;
- }
- }
-
-
- global proc jasperSetRadius( string $jasperCommand )
- {
- float $radius = `floatSliderGrp -q -v radius`;
- float $lowerRadius = `floatSliderGrp -q -v lowerRadius`;
-
- if( $lowerRadius > $radius ) {
- floatSliderGrp -e -v $lowerRadius radius;
- }
- }
-
- global proc jasperStampProfileCallback(
- string $jasperCommand,
- string $parent,
- string $currentTool
- )
- {
- //
- // Profile frameLayout
- //
- floatSliderGrp -e -cc ($jasperCommand + " -e -lowerradius #1 `currentCtx`")
- -dc ( "jasperSetLowerRadius " + $jasperCommand )
- lowerRadius;
- floatSliderGrp -e -cc ($jasperCommand + " -e -radius #1 `currentCtx`")
- -dc ( "jasperSetRadius " + $jasperCommand )
- radius;
-
-
- if ( ( $currentTool != "selectPaint" ) && ( $currentTool != "setEditPaint" ) ) {
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -opacity #1 `currentCtx`")
- opacitySlider;
-
- if ( $currentTool == "wtPaint" || $currentTool == "userPaint"
- || $currentTool == "attrPaint"
- || attrPaintInstCheckTool( $currentTool ) )
- {
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -color #1 #1 #1 `currentCtx`")
- colorSlider;
- }
-
- button -e
- -c ($jasperCommand + " -e -clear `currentCtx`" )
- floodButton;
- }
-
-
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape circle1 `currentCtx`; updateBrushShapeIcons -byCirclePoly")
- bsCirclePoly;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape circle2 `currentCtx`; updateBrushShapeIcons -byCircleGaus")
- bsCircleGaus;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape circle3 `currentCtx`; updateBrushShapeIcons -byCircleSolid")
- bsCircleSolid;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape semiCircle1 `currentCtx`; updateBrushShapeIcons -bySemiCirclePoly")
- bsSemiCirclePoly;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape semiCircle2 `currentCtx`; updateBrushShapeIcons -bySemiCircleSolid")
- bsSemiCircleSolid;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape rectangle `currentCtx`; updateBrushShapeIcons -byRect")
- bsRect;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape lineH `currentCtx`; updateBrushShapeIcons -byLineH")
- bsLineH;
- symbolCheckBox -e
- -cc ($jasperCommand + " -e -brushshape lineV `currentCtx`; updateBrushShapeIcons -byLineV")
- bsLineV;
-
- }
-
-
- global proc jasperValueCallback(
- string $jasperCommand,
- string $parent,
- string $currentTool,
- int $extendValue,
- string $extendValueCallback
- )
- {
- //
- // Stamp Profile frameLayout
- //
- jasperStampProfileCallback( $jasperCommand, $parent, $currentTool );
-
-
- //
- // Operation frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -edittype \"absolute\" `currentCtx`")
- -on2 ($jasperCommand + " -e -edittype \"additive\" `currentCtx`")
- -on3 ($jasperCommand + " -e -edittype \"scale\" `currentCtx`")
- -on4 ($jasperCommand + " -e -edittype \"smooth\" `currentCtx`")
- op0Radio;
-
-
- //
- // Weight Painting frameLayout
- //
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -offset #1 `currentCtx`")
- ptOffset;
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -mult #1 `currentCtx`")
- ptMult;
-
-
- //
- // Clamping frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -clamp \"none\" `currentCtx`")
- -on2 ($jasperCommand + " -e -clamp \"both\" `currentCtx`")
- -on3 ($jasperCommand + " -e -clamp \"lower\" `currentCtx`")
- -on4 ($jasperCommand + " -e -clamp \"upper\" `currentCtx`")
- clampRadio;
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -clamplower #1 `currentCtx`")
- clLower;
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -clampupper #1 `currentCtx`")
- clUpper;
-
- // OBSOLETE
- /*
- if ( $currentTool == "wtPaint" ) {
- textScrollList -e
- -sc ("weightScrollListClick " + $jasperCommand )
- weightScrollList;
- }
- */
-
- if( $extendValue )
- {
- string $cmd = $extendValueCallback + " " + $jasperCommand + " "
- + $parent + " " + $currentTool;
- eval $cmd;
- }
- }
-
-
- // OBSOLETE
- /*
- global proc weightScrollListClick(
- string $jasperCommand
- )
- {
- string $clusterNames[] = eval("textScrollList -q -si weightScrollList");
- string $name = $clusterNames[0];
-
- string $cmd = $jasperCommand + " -e -setnodename " + $name + " `currentCtx`";
- eval( $cmd );
- }
- */
-
-
- proc jasperStrokeCallback(
- string $jasperCommand,
- string $currentTool
- )
- {
- //
- // Reflect Paint frameLayout
- //
- updateReflectionChBox( $jasperCommand );
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -reflectpaint #1 `currentCtx`" )
- reflectStrokeChkBox;
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -reflectpainttype \"reflectU\" `currentCtx`")
- refPaint0Radio;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -reflectpainttype \"reflectV\" `currentCtx`")
- refPaint1Radio;
- if ( $currentTool != "paintColor" ) {
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -reflectpainttype \"reflectMult\" `currentCtx`")
- refPaint2Radio;
- }
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -reflectalongu #1 `currentCtx`")
- singleUSlider;
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -reflectalongv #1 `currentCtx`")
- singleVSlider;
-
- button -e
- -c ($jasperCommand + " -e -reflectalongu 0.5 `currentCtx`")
- reflectUButton;
-
- button -e
- -c ($jasperCommand + " -e -reflectalongv 0.5 `currentCtx`")
- reflectVButton;
-
- if ( $currentTool == "putty" ) {
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -invertrefvector #1 `currentCtx`")
- invertVectorChkBox;
- }
-
-
- //
- // Stylus Pressure frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -pressure \"none\" `currentCtx`")
- -on2 ($jasperCommand + " -e -pressure \"opacity\" `currentCtx`")
- -on3 ($jasperCommand + " -e -pressure \"radius\" `currentCtx`")
- -on4 ($jasperCommand + " -e -pressure \"both\" `currentCtx`")
- pressure0Radio;
-
-
- //
- // Profile Alignment frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -crt \"utangent\" `currentCtx`")
- -on2 ($jasperCommand + " -e -crt \"vtangent\" `currentCtx`")
- compRef0Radio;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -crt \"upvector\" `currentCtx`")
- -on2 ($jasperCommand + " -e -crt \"pathvector\" `currentCtx`")
- compRef1Radio;
- }
-
-
- proc jasperSeamCallback(
- string $jasperCommand,
- string $currentTool
- )
- {
- // display only if nurbs are present
- //
- updateSeamProperties( $jasperCommand );
-
-
- if ( $currentTool == "putty" || $currentTool == "wtPaint"
- || $currentTool == "userPaint" || $currentTool == "attrPaint"
- || attrPaintInstCheckTool($currentTool) )
- {
-
- //
- // Brush Mode frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -brushoperate \"paint\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- -on2 ($jasperCommand + " -e -brushoperate \"selectedge\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- -on3 ($jasperCommand + " -e -brushoperate \"selectcorner\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- brushOperationType;
-
- //
- // Seam AutoCreation frameLayout
- //
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -commedgetol #1 `currentCtx`")
- commEdgesTol;
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -commedgeminlength #1 `currentCtx`")
- commEdgesMinLength;
-
- //
- // Common Edge/Corner frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -commedgedisplay \"off\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- commEdgesDisplay0;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -commedgedisplay \"one\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- commEdgesDisplay1;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -commedgedisplay \"all\" `currentCtx`; updateCommEdgeDisplayScreen " + $jasperCommand )
- commEdgesDisplay2;
-
- button -e
- -c ($jasperCommand + " -e -commedgedisplaynext `currentCtx`; updateCommEdgeOneDisplayScreen " + $jasperCommand )
- commEdgeDisplayOneNext;
- button -e
- -c ($jasperCommand + " -e -commedgedisplayprev `currentCtx`; updateCommEdgeOneDisplayScreen " + $jasperCommand )
- commEdgeDisplayOnePrev;
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -ccd \"off\" `currentCtx` " )
- commCornerDisplay0;
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -ccd \"all\" `currentCtx` " )
- commCornerDisplay1;
- }
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -collapsecvtol #1 `currentCtx`")
- collapseCVTol;
-
- //
- // Stitching Mode frameLayout
- // - this is only displayed in the puttyContext
- //
- if ( $currentTool == "putty" ) {
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -stitchtype \"off\" `currentCtx`")
- -on2 ($jasperCommand + " -e -stitchtype \"pos\" `currentCtx`")
- -on3 ($jasperCommand + " -e -stitchtype \"tan\" `currentCtx`")
- stitchTypeRadio;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -stitchcorner #1 `currentCtx`")
- stitchCornerChkBox;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -polecv #1 `currentCtx`")
- stitchPoleCVChkBox;
-
- button -e
- -c ($jasperCommand + " -e -stitchedgeflood `currentCtx`" )
- stitchNowButton;
- }
- //
- // Common Edge Value Averaging
- // - this is only displayed if we are in wtPaint or userPaint
- //
- else if ( $currentTool == "wtPaint" || $currentTool == "userPaint"
- || $currentTool == "attrPaint"
- || attrPaintInstCheckTool( $currentTool ) )
- {
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -averageedges #1 `currentCtx`")
- averageEdgeValues;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -averagepolecv #1 `currentCtx`")
- averagePoleCVValues;
- }
- }
-
-
-
- proc jasperMaskCallback(
- string $jasperCommand
- )
- {
- //
- // CV Mask frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -maskcv \"off\" `currentCtx`")
- -on2 ($jasperCommand + " -e -maskcv \"select\" `currentCtx`")
- -on3 ($jasperCommand + " -e -maskcv \"unselect\" `currentCtx`")
- cvMaskType;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -displaycv #1 `currentCtx`")
- cvMaskDisplay;
- }
-
-
- proc string imageDirectoryName( )
- {
- // string $dirNames[] = `workspace -q -rt`;
- // string $imageDir = `workspace -q -fn`;
-
- // for ($i=0; $i < size($dirNames); ++$i) {
- // if ( $dirNames[$i] == "sourceImages" ) {
- // if ( ( $i+1 < size($dirNames) ) && ( $dirNames[$i+1] != "images" ) ) {
- // $imageDir = $imageDir + "/" + $dirNames[$i+1];
- // }
- // break;
- // }
- // }
- string $imageDir = `workspace -q -fn`;
-
- return $imageDir;
- }
-
-
- global proc int jasperImportAttributeMapCB(
- string $jasperCommand,
- string $fileName,
- string $fileType
- )
- {
- // display the file name in the text field
- textFieldGrp -e -fileName $fileName importMapNameField;
- updateReloadButton( $jasperCommand );
-
- // execute the jasper command to load the file
- string $dirName = imageDirectoryName();
-
- eval($jasperCommand + " -e -importfilename \"" + $fileName + "\" `currentCtx`");
- eval($jasperCommand + " -e -importfileload \"" + $dirName + "\" `currentCtx`");
-
- // return true to close the filebrowser
- return true;
- }
-
- global proc int jasperExportAttributeMapCB(
- string $jasperCommand,
- string $fileName,
- string $fileType
- )
- {
- // display the file name in the text field
- textFieldGrp -e -fileName $fileName exportMapNameField;
- updateResaveButton( $jasperCommand );
-
- // execute the jasper command to load the file
- string $dirName = imageDirectoryName();
-
- eval($jasperCommand + " -e -exportfilename \"" + $fileName + "\" `currentCtx`");
- eval($jasperCommand + " -e -exportfilesave \"" + $dirName + "\" `currentCtx`");
-
- // return true to close the filebrowser
- return true;
- }
-
-
- global proc jasperImportMapDialog(
- string $jasperCommand
- )
- {
- string $cmd = ($jasperCommand + " -q -workspaceisset `currentCtx`" );
- int $isSet = eval( $cmd );
- if ( $isSet == 0 ) {
- string $workspace = `workspace -q -fn`;
- setWorkingDirectory $workspace "image" "sourceImages";
-
- // set the workspace is set to true
- eval($jasperCommand + " -e -workspaceisset 1 `currentCtx`" );
- }
-
- string $callback = "jasperImportAttributeMapCB " + $jasperCommand + " ";
- fileBrowser( $callback, "Import", "image", 0 );
- }
-
-
- global proc jasperExportMapDialog(
- string $jasperCommand
- )
- {
- string $cmd = ($jasperCommand + " -q -workspaceisset `currentCtx`" );
- int $isSet = eval( $cmd );
- if ( $isSet == 0 ) {
- string $workspace = `workspace -q -fn`;
- setWorkingDirectory $workspace "image" "sourceImages";
-
- // set the workspace is set to true
- eval($jasperCommand + " -e -workspaceisset 1 `currentCtx`" );
- }
-
- string $callback = "jasperExportAttributeMapCB " + $jasperCommand + " ";
- fileBrowser( $callback, "Export", "map", 1 );
- }
-
- global proc jasperImportReloadMap(
- string $jasperCommand
- )
- {
- string $fileName = eval("textFieldGrp -q -fileName importMapNameField");
- if ( $fileName != "" ) {
- string $dirName = imageDirectoryName();
- eval($jasperCommand + " -e -importfileload \"" + $dirName + "\" `currentCtx`");
- }
- }
-
- global proc jasperExportReloadMap(
- string $jasperCommand
- )
- {
- string $fileName = eval("textFieldGrp -q -fileName exportMapNameField");
- if ( $fileName != "" ) {
- string $dirName = imageDirectoryName();
- eval($jasperCommand + " -e -exportfilesave \"" + $dirName + "\" `currentCtx`");
- }
- }
-
- global proc importFileLoad(
- string $jasperCommand
- )
- {
- // change the reload button if necessary
- updateReloadButton( $jasperCommand );
-
- string $fileName = eval("textFieldGrp -q -fileName importMapNameField");
- if ( $fileName != "" ) {
- // execute the jasper command to load the file
- string $dirName = imageDirectoryName();
- eval($jasperCommand + " -e -importfilename \"" + $fileName + "\" `currentCtx`");
- eval($jasperCommand + " -e -importfileload \"" + $dirName + "\" `currentCtx`");
- }
- }
-
- global proc exportFileSave(
- string $jasperCommand
- )
- {
- // change the resave button if necessary
- updateResaveButton( $jasperCommand );
-
- string $fileName = eval("textFieldGrp -q -fileName exportMapNameField");
- if ( $fileName != "" ) {
- // execute the jasper command to save the file
- string $dirName = imageDirectoryName();
- eval($jasperCommand + " -e -exportfilename \"" + $fileName + "\" `currentCtx`");
- eval($jasperCommand + " -e -exportfilesave \"" + $dirName + "\" `currentCtx`");
- }
- }
-
-
- proc jasperMapCallback(
- string $jasperCommand,
- string $currentTool
- )
- {
- //
- // Import Map frameLayout
- //
- textFieldGrp -e
- -cc ($jasperCommand + " -e -importfilename \"#1\" `currentCtx`; importFileLoad " + $jasperCommand )
- importMapNameField;
-
- button -e
- -c ( "jasperImportReloadMap \"" + $jasperCommand + "\"" )
- importReloadButton;
-
- button -e
- -c ( "jasperImportMapDialog \"" + $jasperCommand + "\"" )
- importMapButton;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -importreassign #1 `currentCtx`" )
- reassignMapsChkBox;
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -importfilemode \"alpha\" `currentCtx`")
- -on2 ($jasperCommand + " -e -importfilemode \"luminance\" `currentCtx`")
- importMapAlphaValueRadio1;
-
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -importfilemode \"red\" `currentCtx`")
- -on2 ($jasperCommand + " -e -importfilemode \"green\" `currentCtx`")
- -on3 ($jasperCommand + " -e -importfilemode \"blue\" `currentCtx`")
- importMapAlphaValueRadio2;
-
- if ( attrPaintInstCheckTool($currentTool) ) {
- string $name = eval("attrPaintCtx -q -bcn `currentCtx`");
- if ( $name == "polyClrVertPaint" ) {
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -importfilemode \"rgb\" `currentCtx`")
- -on2 ($jasperCommand + " -e -importfilemode \"rgba\" `currentCtx`")
- importMapAlphaValueRadio3;
- }
- }
-
-
- if ( $currentTool == "selectPaint" ) {
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -importthreshold #1 `currentCtx`" )
- importSelectCVThresholdSlider;
- }
-
- //
- // Export Map frameLayout
- //
- if ( ( $currentTool == "wtPaint" ) ||
- ( $currentTool == "userPaint") ||
- ( $currentTool == "attrPaint") ||
- ( attrPaintInstCheckTool( $currentTool ) ) ||
- ( $currentTool == "selectPaint" ) )
- {
- textFieldGrp -e
- -cc ($jasperCommand + " -e -exportfilename \"#1\" `currentCtx`; exportFileSave " + $jasperCommand )
- exportMapNameField;
-
- button -e
- -c ( "jasperExportReloadMap \"" + $jasperCommand + "\"" )
- exportReloadButton;
-
- button -e
- -c ( "jasperExportMapDialog \"" + $jasperCommand + "\"" )
- exportMapButton;
-
- // determine if this is 3d or 1d paint
- //
- string $name = "";
- if ( attrPaintInstCheckTool($currentTool) ) {
- $name = eval("attrPaintCtx -q -bcn `currentCtx`");
- }
-
- // if this is not 3d color paint tool (1d case)
- //
- if ( $name != "polyClrVertPaint" ) {
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -exportfilemode \"alpha\" `currentCtx`")
- -on2 ($jasperCommand + " -e -exportfilemode \"luminance\" `currentCtx`")
- exportMapValueRadio1;
- } else {
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -exportfilemode \"alpha\" `currentCtx`")
- -on2 ($jasperCommand + " -e -exportfilemode \"rgb\" `currentCtx`")
- -on3 ($jasperCommand + " -e -exportfilemode \"rgba\" `currentCtx`")
- exportMapValueRadio2;
- }
-
- intSliderGrp -e
- -cc ($jasperCommand + " -e -exportfilesizex #1 `currentCtx`; adjustMapSizeSlider " + $jasperCommand + " " + "xSlider")
- exportMapSizeXSlider;
-
- intSliderGrp -e
- -cc ($jasperCommand + " -e -exportfilesizey #1 `currentCtx`; adjustMapSizeSlider " + $jasperCommand + " " + "ySlider")
- exportMapSizeYSlider;
-
- checkBoxGrp -e
- -cc1 ("setAspectRatio " + $jasperCommand )
- exportKeepAspectChkBox;
-
- optionMenuGrp -e
- -cc ($jasperCommand + " -e -exportfiletype \"#1\" `currentCtx`")
- imageFormatOptionMenu;
- }
- }
-
-
- proc jasperDisplayCallback(
- string $jasperCommand,
- string $currentTool
- )
- {
- //
- // Surface frameLayout
- //
- string $currentContext = `currentCtx`;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -outline #1 `currentCtx`; updateBrushFeedback " + $jasperCommand )
- drawOutlineChkBox;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -brushfeedback #1 `currentCtx`" )
- brushFeedbackChkBox;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -outlinepaint #1 `currentCtx`; updateBrushFeedback " + $jasperCommand )
- drawOutlinePaintingChkBox;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -showactive #1 `currentCtx`")
- showActiveLinesChkBox;
-
- //
- // Color feedback frameLayout
- // - this is only displayed for wtPaint and userPaint tools
- //
- if ( ( $currentTool == "wtPaint" ) || ( $currentTool == "userPaint")
- || $currentTool == "attrPaint" || attrPaintInstCheckTool( $currentTool ) )
- {
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -colorfeedback #1 `currentCtx`")
- colorFeedbackChkBox;
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -disablelighting #1 `currentCtx`")
- disableLightingChkBox;
- if ( $currentTool == "wtPaint" ) {
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -usesetcolor #1 `currentCtx`")
- useSetColorChkBox;
- }
-
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -colorrangelower #1 `currentCtx`")
- crLower;
- floatSliderGrp -e
- -cc ($jasperCommand + " -e -colorrangeupper #1 `currentCtx`")
- crUpper;
- }
-
- if ( $currentTool == "setEditPaint" ) {
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -setcolorfeedback #1 `currentCtx`" )
- setEditColorFeedbackChkBox;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -setdisplaycvs #1 `currentCtx`" )
- setEditDisplayCVsChkBox;
- }
- }
-
-
- proc jasperMiscCallback(
- string $jasperCommand
- )
- {
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- //
- // Multiple Surface Detection frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -multisurface \"infinite\" `currentCtx`; updateInFinite " + $jasperCommand )
- -on2 ($jasperCommand + " -e -multisurface \"finite\" `currentCtx`; updateFinite " + $jasperCommand )
- multiSurfaceRadio;
-
- intSliderGrp -e
- -cc ($jasperCommand + " -e -multisurfacesize #1 `currentCtx`")
- multiSurfaceSizeSlider;
-
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -multisurfacemode #1 `currentCtx`" )
- multiSurfaceModeChkBox;
- updateMultiSurfaceModeChkBox( $jasperCommand );
-
-
- //
- // Stamp Compensation frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -compensate \"none\" `currentCtx`")
- comp0Radio;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -compensate \"linear\" `currentCtx`")
- comp1Radio;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -compensate \"grid\" `currentCtx`")
- comp2Radio;
-
- intSliderGrp -e
- -cc ($jasperCommand + " -e -compgridradius #1 `currentCtx`")
- compGridRadius;
-
- //
- // Paint Type frameLayout
- //
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -painttype \"projective\" `currentCtx`")
- paintType0Radio;
- radioButtonGrp -e
- -on1 ($jasperCommand + " -e -painttype \"texture\" `currentCtx`")
- paintType1Radio;
- updateReflectionChBox( $jasperCommand );
- updateStampCompensation( $jasperCommand );
-
-
- //
- // Stroke Smoothing frameLayout
- //
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -tsmoothing #1 `currentCtx`")
- texSmoothChkBox;
- checkBoxGrp -e
- -cc1 ($jasperCommand + " -e -ssmoothing #1 `currentCtx`")
- screenSmoothChkBox;
- intSliderGrp -e
- -cc ($jasperCommand + " -e -ssmoothingiters #1 `currentCtx`")
- divisionSlider;
-
-
- // Pre and Post stroke command frameLayout
- //
- textFieldGrp -e
- -cc ($jasperCommand + " -e -bsc \"#1\" `currentCtx`")
- preStrokeTextField;
- textFieldGrp -e
- -cc ($jasperCommand + " -e -asc \"#1\" `currentCtx`")
- postStrokeTextField;
- }
-
-
- //
- // $jasperMode == "putty", "wtPaint" "userPaint" "selectPaint"
- // $section == "sculpt"/"weight"/"select"/"script", "stroke"
- // "seam", "mask", "file", "display", "misc"
- //
- global proc jasperCallback( string $jasperCommand,
- string $section,
- string $parent,
- string $colorSliderCB )
- {
-
- string $currentContext = `currentCtx`;
- string $currentTool = `contextInfo -c $currentContext`;
-
- // OBSOLETE
- /*
- if ( $section == "Paint" ) {
- paintColorTabCallback( $jasperCommand, $parent, $currentTool );
- }
- else if ( $section == "File_Textures" ) {
- paintColorFileCallback( $jasperCommand );
- }
- else if( $section == "Weight" ) {
- jasperValueCallback( $jasperCommand, $parent, $currentTool, false, "" );
- }
- else if( $section == "Attr" ) {
- jasperAttrCallback( $jasperCommand, $currentTool );
- }
- */
-
- if( $section == "Sculpt" ) {
- jasperSculptCallback( $jasperCommand, $parent, $currentTool );
- }
- // else if( $section == "Script_Paint" || $section == "Attr__Paint" ) {
- else if( $section == "Script_Paint" )
- {
- jasperValueCallback( $jasperCommand, $parent, $currentTool, false, "" );
- }
- else if( $section == "Select" ) {
- jasperSelectCallback( $jasperCommand, $parent, $currentTool);
- }
- else if( $section == "SetMembership" ) {
- jasperSetEditCallback( $jasperCommand, $parent, $currentTool);
- }
- else if( $section == "Stroke" ) {
- jasperStrokeCallback( $jasperCommand, $currentTool );
- }
- else if( $section == "Seam" ) {
- jasperSeamCallback( $jasperCommand, $currentTool );
- }
- else if( $section == "Mask" ) {
- jasperMaskCallback( $jasperCommand );
- }
- else if( $section == "Map" ) {
- jasperMapCallback( $jasperCommand, $currentTool );
- }
- else if( $section == "Display" ) {
- // OBSOLETE
- /*
- if ( $currentTool == "paintColor" ) {
- paintColorDisplayCallback( $jasperCommand );
- } else {
- */
- jasperDisplayCallback( $jasperCommand, $currentTool );
- }
- else if( $section == "Misc" ) {
- // OBSOLETE
- /*
- if ( $currentTool == "paintColor" ) {
- paintColorMiscCallback( $jasperCommand );
- } else {
- */
- jasperMiscCallback( $jasperCommand );
- }
- else if( $section == "Setup" ) {
- jasperSetupCallback( $jasperCommand );
- }
- else {
- attrPaintInstCallbackDefine(
- $jasperCommand, $parent, $currentTool, $section
- );
- }
- }
-